PROGRAM XTP4; (* TURBO PASCAL 4 & 5 SAMPLE *)
{$M 16384, 0, 65536}
USES SORTBTPU;
VAR
   INFILE,
   OUTFILE,
   CTL_STMT: STRING;
   NUM_RECS: INTEGER;
   RET_CODE: INTEGER;

(* NUM_RECS CAN BE A LONGINT IF YOU USE
   THE 4BYTE PARAMETER IN YOUR CTL_STMT *)

BEGIN (*XTP4 - MAIN PROGRAM*)

   INFILE       := 'SAMP.DAT';
   OUTFILE      := 'SORTED.DAT';
   CTL_STMT     := 'S(1,10,C,A)';

   WRITELN('CALLING OPT-TECH SORT...');

   SORTBTP(INFILE,
           OUTFILE,
           CTL_STMT,
           NUM_RECS,
           RET_CODE);

   WRITELN('BACK FROM OPT-TECH SORT');
   WRITELN('NUMBER OF RECORDS =',NUM_RECS);
   WRITELN('SORT STATUS       =',RET_CODE);
END.
